#include "SharedMemory.hpp"
#include "Fifo.hpp"

int main()
{
    SharedMemory shm(pathname, projid, CREATER);
    FifoHandler readerfifo;
    readerfifo.OpenForRead();

    char *start = (char *)shm.StartMem();

    while (true)
    {
        char c;
        if (readerfifo.Wait(&c, 1)) // 默认阻塞
        {
            printf("%s\n", start);
        }
        else
        {
            break;
        }
    }

    readerfifo.Close();
    return 0;
}